
export function gaugeChartFun(data) {
  const splitLineLength = '13%';
  const splitLineDistance = -6;
  const splitLineWidth = 2;
  let gaugeOption = {
    title: {
        text: '{a|' + data.value + '}\n{c|' + data.title + '}',
        x: 'center',
        y: 'center',
        textStyle: {
            rich: {
                a: {
                    fontSize: 24,
                    color: '#fff',
                    fontWeight:'600',
                },
                c: {
                    fontSize: 14,
                    color: '#fff',
                    padding: [4, 0, 0, 0]
                }
            }
        }
    },

    series: [
        {
            type: 'pie',
            name: '外层细圆环',
            radius: ['97%', '100%'],
            hoverAnimation: true,
            clockWise: false,
            itemStyle: {
                normal: {
                    color: '#16324A',
                },
            },
            label: {
                show: false,
            },
            data: [100],
        },
        {
            type: 'pie',
            name: '里层细圆环1',
            radius: ['75%', '78%'],
            hoverAnimation: true,
            clockWise: false,
            itemStyle: {
                normal: {
                    color: '#16324A',
                },
            },
            label: {
                show: false,
            },
            data: [100],
        },
        {
            type: 'pie',
            name: '里层细圆环2',
            radius: ['64%', '66%'],
            hoverAnimation: true,
            clockWise: false,
            itemStyle: {
                normal: {
                    color: '#16324A',
                },
            },
            label: {
                show: false,
            },
            data: [100],
        },
       {
          type: 'pie',
          radius: ['96%', '78%'],
          silent: true,
          clockwise: true,
          startAngle: -35,
          z: 0,
          zlevel: 0,
          data: [
             {
                value: data.value ,
                itemStyle: {
                   color:{
                    type: 'linear',
                    x: 0,
                    y: 0,
                    x2: 0,
                    y2: 1,
                    colorStops: [{
                        offset: 0, color: 'rgba(81, 191, 252, 1)' // 0% 处的颜色
                    }, {
                        offset: 1, color: 'rgba(81, 191, 252, 1)' // 100% 处的颜色
                    }],
                    global: false // 缺省为 false
                  }
                },
                label: {
                  show: false
                }
             },
             {
                value: 100 - data.value ,
                label: {
                   show: false
                },
                itemStyle: {
                   normal: {
                      color: '#0C2138'
                   }
                }
             }
          ]
       },
       {
          name: '',
          type: 'gauge',
          radius: '97%',
          center: ['50%', '50%'],
          startAngle: 0,
          endAngle: 360,
          splitNumber: 60,
          hoverAnimation: true,
          axisTick: {
             show: false
          },
          splitLine: {
             length: splitLineLength,
             distance: splitLineDistance,
             lineStyle: {
                width: splitLineWidth,
                color: '#0C1F36'
             }
          },
          axisLabel: {
             show: false
          },
          pointer: {
             show: false
          },
          axisLine: {
             show: false
          }
       }
    ]
  }
  
  return gaugeOption
}